$(document).ready(function () {
    let obj=new Object();
    obj.m="getLoginMember";
    $.ajax({
        async:true,
        // Ajax请求设置xhrFields的withCredentials为true实现跨域访问
        xhrFields: {
            withCredentials: true
        },
        type:"POST",
        url:basePath2+"/api/member",
        dataType:"json",
        data:obj,
        success:function (result) {
            console.log(result);
            makeMemberInfoView(result);
        },
        error:function (e) {
            console.log(e.status);
            console.log(e.responseText);
        }
    });
})

/**
 * 产生已登录用户的信息
 */
function makeMemberInfoView(result) {
    console.log("------------接口中获得session中的信息------------")
    console.log(result);
    //组装页面
    let member=result.data;
    $("#leverName").text(member.leverName);
    $("#favourable").text(member.favourable);
    $("#memberName").val(member.memberName);
    $("#phone").val(member.phone);
    $("#zip").val(member.zip);
    $("#address").val(member.address);


}